﻿using System;
using System.Threading.Tasks;
using Syufy.BINLookup.Web.Models;

namespace Syufy.BINLookup.Web.Interfaces
{
    /// <summary>
    /// Unit of work interface for database repositories.
    /// </summary>
    public interface IUnitOfWork : IDisposable
    {
        /// <summary>
        /// Get unit of work for entity.
        /// </summary>
        IGenericRepository<TEntity> GetRepository<TEntity>() where TEntity : class;

        /// <summary>
        /// Save database context.
        /// </summary>
        void Save();

        /// <summary>
        /// Save database context (async).
        /// </summary>
        Task SaveAsync();
    }
}
